
import Vue from "vue";
import  { Tooltip } from 'view-design'

//页面状态相关
let status = {
  allotModal:{
    isShow:false,
    isLoading:false,
    userInfo:{
      id:"",
      fullName:"",
      inviteCode:"",
      contactEmail:"",
      isMatched:false
    }
  },
  //查看图片
  modalImage: {
    isShow: false,
    url: ''
  },
};

// 和网络交互相关的参数
let params = {
  allotUserListParam:{
    fullName:"",
    email:""
  }
};

// 页面的数据源
let data = {
  allotUserList:[],
};

let matchTableTitles=function (self) {
  var titles =  [
 {
      type: 'index',
      title: '#',
      width: 50,
      key: 'index',
    },
    {
      title: '负责人',
      key: 'employeeName',
      width: 90,
      align: "center",
    },
    {
      title: '目标用户姓名',
      key: 'fullName',
      width: 160,
      render: (h, params) => {
        return self.isMatchValue(1,params.row.fullName);
      }
    },
    {
      title: '抓取邮箱',
      key: 'email',
      width: 160,
      render: (h, params) => {
        return  self.isMatchValue(2,params.row.email)
      }
    },
    {
      title: '补充邮箱',
      key: 'externalEmail',
      width: 160,
      render: (h, params) => {
        return  self.isMatchValue(2, params.row.externalEmail);
      }
    },
    {
      title: '内部编号',
      key: 'number',
      width: 160,
      align: "center"
    },
    {
      title: '状态',
      key: 'state',
      width: 100,
      render: (h, params) => {
        return h('div', self.targetCustomerStateDict.filter(item => item.value == params.row.state)[0].name);
      }
    },
    {
      title: '操作',
      key: 'operation',
      width: 190,
      render: (h, params) => {
        return  self.isUserMatchedView(params.index);
      }
    },
  ]

  return self.$authTableTitles(titles);
};


export  default  {
  tStatus: status,
  tParams: params,
  tData: data,
  matchTableTitles:matchTableTitles
};
